package com.neusoft.elm.controller;

import javax.servlet.http.HttpServletRequest;

import com.neusoft.elm.service.OrdersService;
import com.neusoft.elm.service.PointsService;
import com.neusoft.elm.service.impl.OrdersServiceImpl;
import com.neusoft.elm.service.impl.PointsServiceImpl;

public class PointController {

	public Object updateUserPoint(HttpServletRequest request) throws Exception{
		String userId = request.getParameter("userId");
		Integer point = Integer.valueOf(request.getParameter("point"));
	    PointsService service = new PointsServiceImpl(); 
	    int result = service.updateUserPoint(userId, point); 
	    return result;
	}
	
	public Object getPointById(HttpServletRequest request) throws Exception {
		 String userId = request.getParameter("userId");
	     PointsService service = new PointsServiceImpl();
	     int point = service.getPointById(userId);
	     return point;
	}
}
